﻿@model List<Cnm.Models.ViewModels.CategoryViewModel>
@if (Model != null)
{
    <div class="category-listing">
        <ul class="sf-menu">
            @foreach (var menu in Model)
            {
                var sename = ViewContext.RouteData.Values["Sename"];
                <li class="cat-item @(sename != null && sename.ToString() == menu.SeName ? "sf-active" : "")">
                    <a href="@Url.RouteUrl("Category", new {menu.SeName})" class="sf-with-ul">
                        @menu.Name
                        @if (menu.Childs != null && menu.Childs.Count > 0)
                        {
                            <span class="sf-sub-indicator">›</span>
                        }
                    </a>
                    @if (menu.Childs != null && menu.Childs.Count > 0)
                    {
                        <ul class="children">
                            @foreach (var categoryViewModel in menu.Childs)
                            {
                                <li class="cat-item">
                                    <a href="@Url.RouteUrl("Category", new {categoryViewModel.SeName})">@categoryViewModel.Name</a>
                                </li>
                            }
                        </ul>
                    }
                </li>
            }
        </ul>
    </div>
}